stack: query preferred size for last_visible_child
authorChristian Hergert <chergert@redhat.com>
Sat, 19 Mar 2016 02:27:31 +0000 (19:27 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 21 Mar 2016 15:50:27 +0000 (11:50 -0400)
When animating, we might be changing the size allocation of the previous
stack child. However, we were not querying the size in the process
meaning you would often see warnings about allocating the size without
knowing what it should be.

This simply adds an innocuous size request, since responding to last_child
sizing requests is not all that critical in the transition.

https://bugzilla.gnome.org/show_bug.cgi?id=763900

gtk/gtkstack.c

index 8eaa09017ab8a5ace3be0d5b01ff6ea2a8f420e6..89ddf58117e7dafc644e42828a86479e2a42762b 100644 (file)
@@ -2258,7 +2258,14 @@ gtk_stack_allocate (GtkCssGadget        *gadget,
   child_allocation.height = allocation->height;
 
   if (priv->last_visible_child)
-    gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation);
+    {
+      int min, nat;
+
+      gtk_widget_get_preferred_height_for_width (priv->last_visible_child->widget,
+                                                 allocation->width,
+                                                 &min, &nat);
+      gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation);
+    }
 
   if (priv->visible_child)
     {